#include <stdio.h>
#include <unistd.h>
#include <sys/shm.h>

int main(){
      int shm_id = shmget(0x12121212, 100, IPC_CREAT | 0664);
      if(shm_id < 0){
          perror("shmget");
          return 0;
                            
      }
      struct shmid_ds sd;
      shmctl(shm_id, IPC_STAT, &sd);
      printf("shm size : %ld\n", sd.shm_segsz);
      int count = 20;
      while(count--){
         sleep(1);
      }
      shmctl(shm_id, IPC_RMID, NULL);
      return 0;

}
